from pelican import Pelican
from pelican.contents import Article

# Create a custom article
article = Article(
    title="Custom Post",
    content="This is a programmatically generated post.",
    metadata={'date': '2023-10-01', 'category': 'Blog'},
)

# Add the article to Pelican
settings = {
    'PATH': 'content',
    'OUTPUT_PATH': 'output',
}
pelican = Pelican(settings)
pelican.content = [article]
pelican.run()